/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entitytablemode;

import entity.Order;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;
import manager.managerOrder;

/**
 *
 * @author NgocNam
 */
public class OrderTableModel_two extends AbstractTableModel{
        
        private ArrayList<Order> list;
        public OrderTableModel_two(ArrayList<Order> list){
            this.list=list;
           
        }
    
        
    @Override
    public int getRowCount() {
        return list.size();
    }

    @Override
    public int getColumnCount() {
        return 8;
    }

    @Override
    public Object getValueAt(int row, int cloumn) {
        Order o=list.get(row);
        switch(cloumn){
            case 0:return o.getOrderID();
            case 1:return o.getEmployeeID();
            case 2:return o.getStratDate();
            case 3:return o.getEndDate();
            case 4:return o.getReasons();
            case 5:return o.getStatus();
            case 6:return o.getDateBackFact();
            case 7:return o.getResons_Delay();
              default: return null;        
        }
    }
    public String getColumnName(int column) {
        switch(column){
            case 0: return "Order ID";
            case 1: return "Employee Name";
            case 2: return "Star Date";
            case 3: return "End Date";
            case 4: return "Reasons";
            case 5: return "Status";
            case 6: return "Date Back Fact";
            case 7: return "Reasons Delay";
                default:return  null;
        }
    }
    
}
